package com.movisol.adsservice.client;

import java.io.Serializable;
import java.util.Date;
/**
 * 
 * @author Daniel
 * Cotrol de chache del xml de publicidad
 */
public class AdCache implements Serializable {
protected Date dateSaved;
protected String fileName;
protected double interval;
public AdCache(Date dateSaved, String fileName, double interval) {
	super();
	this.dateSaved = dateSaved;
	this.fileName = fileName;
	this.interval = interval;
}
public boolean isExpired(){
	 Date today = new Date();
	
	if (dateSaved==null){
		return true;
	}else {
		double dateDiff;
		 dateDiff =(double)(today.getTime()- dateSaved.getTime())/60000;
		if (dateDiff>interval) 
		{
			return true;
		}else 
			return false;
	}
}
}
